package com.xywl.escort.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xywl.escort.R;
import com.xywl.escort.bean.PayTypeBean;

import java.util.List;

public class PayTypeAdapter extends BaseQuickAdapter<PayTypeBean, BaseViewHolder> {
    public PayTypeAdapter(int layoutResId, @Nullable List<PayTypeBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PayTypeBean item) {
        ImageView imgChoose = helper.getView(R.id.img_choose);
        if (item.isChoose) {
            imgChoose.setImageResource(R.mipmap.bazaar_choose);
        } else {
            imgChoose.setImageResource(R.mipmap.bazaar_not_to_choose);
        }
        helper.setText(R.id.text_title, item.name);
        helper.addOnClickListener(R.id.layout_pay_item);
    }
}
